#ifndef _FACTORY_H_
#define _FACTORY_H_
/*
    created： 2023/3/30
    filename: Factory.h
    author: 李东霖
    purpose: Factory模式的演示代码
*/
//创建的对象的基类
class Product
{
public:
    Product() = default;
    virtual ~Product() = default;
};

//需要实例化的对象类
class ConcreateProduct:public Product
{
public:
    ConcreateProduct();
    virtual ~ConcreateProduct();
};

//创建工厂的抽象基类
class Creator
{
public:
    Creator();
    virtual ~Creator();
    
    void AnOperation();

protected:
    virtual Product* FactoryMethod() = 0;
};

//继承工厂基类的派生类
class ConcreateCreator:public Creator
{
public:
    ConcreateCreator();
    virtual ~ConcreateCreator();
protected:
    virtual Product* FactoryMethod() override;

};

#endif //!_FACTORY_H_